import request from '@/utils/request'

// 查询菜单列表
export function listIndicatorData(query) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/selectPage',
    method: 'get',
    params: query
  })
}
// 导出菜单列表
export function exportIndicatorData(query) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/selectPage',
    method: 'get',
    params: query,
    responseType: 'blob',
  })
}
// 导入指标列表
export function importIndicatorData(data) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/importData',
    method: 'post',
    data
  })
}
// 新增指标列表
export function addIndicatorData(data) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/addTargetResolve',
    method: 'post',
    data
  })
}
// 通过id获取详情页数据
export function editIndicatorData(data) {
  return request({
    url: `/goldwind/performance/pt-target-resolve/selectByIdAndType/?id=` + data.id + '&'+ 'type=' + data.type,
    method: 'get',
  })
}
// 新增菜单列表
export function delIndicatorData(ids) {
  return request({
    url: `/goldwind/performance/pt-target-resolve/deleteByIds/?ids=` + ids,
    method: 'delete'
  })
}

// 修改指标明细菜单列表
export function reqUpdateIndicatorDetail(data) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/updateDetail',
    method: 'put',
    data: data
  })
}
// 修改指标分解状态
export function stateChange(data) {
  return request({
    url: '/goldwind/performance/pt-target-resolve/updateTargetResolve',
    method: 'put',
    data: data
  })
}